<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>k8s</title>
    <style type="text/css">
        body{margin: 0;padding: 0; background: #393D49;}
        .main{width: 100%;height: 100%; }
        .left{width: 20%;background-color: #393D49;height: 100%;float: left;}
        .right{width: 80%;background-color: #222629;height: 100%;float: right;}
    </style>
</head>
<link rel="stylesheet" href="../../compute/static/layui-v2.6.8/layui/css/layui.css">
<script src="../../compute/static/codemirror/mode/javascript/javascript.js"></script>
<script src="../../compute/static/layui-v2.6.8/layui/layui.js"></script>
<script src="../../compute/static/jquery-3.3.1.min.js"></script>
<body>
<div class="main">
    <div class="left">
        <ul class="layui-nav layui-nav-tree" lay-filter="test" style="width: auto">
<!--            导航-->
            <li class="layui-nav-item layui-nav-itemed">
                <dd class="main_left"><a href="javascript:" data-src="/compute/new/overview">概览</a></dd>
            </li>
            <li class="layui-nav-item layui-nav-itemed">
                <a href="javascript:;">集群</a>
                <dl class="layui-nav-child">
                    <dd class="main_left"><a href="javascript:" data-src="/compute/new/Nodes">Nodes</a></dd>
                    <dd class="main_left"><a href="javascript:" data-src="/compute/new/Namespaces">Namespaces</a></dd>
                    <dd class="main_left"><a href="javascript:" data-src="/compute/new/Pods">Pods</a></dd>
                    <dd class="main_left"><a href="javascript:" data-src="/compute/new/Services">Services</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item layui-nav-itemed">
                <dd class="main_left"><a href="javascript:" data-src="/compute/new/createyaml">创建应用</a></dd>
            </li>
        </ul>
    </div>
    <div class="right">
        <iframe frameborder="0" scrolling="yes" style="width:100%;height:100%" src="/compute/new/overview" id="aa"></iframe>
    </div>
</div>
</body>
</html>
<script>
    //注意进度条依赖 element 模块，否则无法进行正常渲染和功能性操作
    layui.use('element', function(){
        var element = layui.element;
    });

    $(function(){
        //获取src值
        $(".main_left a").on("click",function(){
            var address =$(this).attr("data-src");
            $("iframe").attr("src",address);
        });
        //一下代码是根据窗口高度在设置iframe的高度
        var frame = $("#aa");
        var frameheight = $(window).height();
        console.log(frameheight);
        frame.css("height",frameheight);
    });

</script>
